// margin padding 边距类 acss

$direction: (l left, r right, t top, b bottom);

@for $i from 0 through 30 {
    @each $type in m, p, v, h, a {
        @if $type == m {
            @each $d in $direction {
                @include iClass(m#{nth($d, 1)}-#{$i}) {
                    margin-#{nth($d, 2)}: #{$i}px;
                }
            }
        } @else if $type == p {
            @each $d in $direction {
                @include iClass(p#{nth($d, 1)}-#{$i}) {
                    padding-#{nth($d, 2)}: #{$i}px;
                }
            }
        } @else if $type == h {
            @include iClass(ph-#{$i}) {
                padding-left: #{$i}px;
                padding-right: #{$i}px;
            }

            @include iClass(mh-#{$i}) {
                margin-left: #{$i}px;
                margin-right: #{$i}px;
            }
        } @else if $type == v {
            @include iClass(pv-#{$i}) {
                padding-top: #{$i}px;
                padding-bottom: #{$i}px;
            }
        } @else {
            @include iClass(pa-#{$i}) {
                padding: #{$i}px;
            }
        }
    }
}

@include iClass(mv-0) {
    margin-top: 0;
    margin-bottom: 0;
}
